<template>
  <div>
    <div>请打开控制台查看</div>
    <div>多域名请求，默认有加载特效</div>
    <el-button type="primary" @click="test1">域名1</el-button>
    <el-button type="primary" @click="test2">域名2</el-button>
    <br />
    <br />
    <el-button type="primary" @click="noLoading">无加载特效</el-button>
    <br />
    <br />
    <p>仅做基础示例，具体请查阅 src/utils/http/index.ts 文件</p>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { getUser, getImgs } from '@/api'

const test1 = async () => {
  const res = await getUser()
  if (res.isSuccess) {
    console.log(res)
  }
}
const test2 = () => {
  getImgs().then((res) => console.log(res))
}

const noLoading = async () => {
  const res = await getImgs({}, { showLoading: false })
  if (res.isSuccess) {
    console.log(res)
  }
}
</script>

<style scoped lang="scss"></style>
